import { ui } from "../../ui/layaMaxUI";
import Game from "../../core_wq/game/Game";
import GameEvent from "../../core_wq/game/GameEvent";
import SoundMgr from "../../core_wq/sound/SoundMgr";
import SoundType from "../../core_wq/sound/SoundType";



export default class LoseView extends ui.moduleView.gameOver.LoseViewUI {


        onEnable(){
            if(this.continueBtn){
                this.scale(0,0);
                this.continueBtn.on(Laya.Event.CLICK, this, this.onClickContinue);
                this.back.on(Laya.Event.CLICK, this, this.onClickBack);

                Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 700, Laya.Ease.quadOut);
                SoundMgr.Ins.stopBg();
                SoundMgr.Ins.playEffect(SoundType.LOSE);
            }
        }

        onClickContinue(){
            this.removeSelf();
            Laya.stage.event(GameEvent.GAME_AGAIN);
            SoundMgr.Ins.playEffect(SoundType.CLICK);
        }

        onClickBack(){
            this.removeSelf();
            Laya.stage.event(GameEvent.GO_HOME);
            SoundMgr.Ins.playEffect(SoundType.CLICK);
        }


}